package com.wang.experiment.experiment2;

/**
 * @author wr
 * @date 2021/10/13 20:42
 */
public class One {
    public static void main(String[] args) {
        Pay pay = new Pay(100);
        System.out.println(pay.computePayment(1));
        System.out.println(pay.computePayment(1,0.5));
        System.out.println(pay.computePayment(1, 0.5, 0.005));
    }
}

class Pay {
    private double price;
    //实在没看懂下面这三个成员变量有什么用
    private double withholdRate;
    private double payRate;
    private double payment;

    Pay(double price) {
        this.price = price;
    }

    public double computePayment(double hours, double withholdRate, double payRate) {
        return hours * price * (1 - withholdRate) * (1 - payRate);
    }

    public double computePayment(double hours, double payRate) {
        return hours * price * (1 - 0.15) * (1 - payRate);
    }

    public double computePayment(double hours) {
        return hours * price * (1 - 0.15) * (1 - 0.0465);
    }
}
